{%extends "admin/base.html"%}
{%block title%}
正在编辑"{{book.name}}" - {{site["name"]|upper}}
{%endblock title%}

{%block styles%}
{%if config.get("DEBUG")%}
{%include "_common-css.html"%}
<link rel="stylesheet" href="{{url_for("static", filename="asserts/bookeditor/plugins/bootstrap-treeview/bootstrap-treeview.min.css")}}">
<link rel="stylesheet" href="{{url_for("static", filename="asserts/bookeditor/plugins/katex/katex.css")}}">
<link rel="stylesheet" href="{{url_for("static", filename="asserts/bookeditor/plugins/codemirror/lib/codemirror.css")}}">
<link rel="stylesheet" href="{{url_for("static", filename="asserts/jquery-file-upload/css/jquery.fileupload.css")}}">
<link rel="stylesheet" href="{{url_for("static", filename="asserts/bookeditor/bookeditor.css")}}">
<link rel="stylesheet" href="{{url_for("static", filename="css/admin/edit.css")}}">
{%else%}
<link rel="stylesheet" href="{{url_for("static", filename="dist/css/edit.min.css")}}">
{%endif%}

<style>
    body{background: #f9f9f9;}
</style>
{{super()}}
{%endblock styles%}

{%block navbar%}
{%endblock navbar%}

{%block content%}
    <div class="doc-wraper" id="doc-wraper">
    </div>


<div class="modal book-modal fade" id="import-modal" role="dialog" aria-labelledby="exampleModalLabel" style="display: none;">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="dialog-tab dialog-import">
                <h3 class="modal-title">导入外部数据</h3>
                <ul class="select-tab nav nav-tabs">
                    <li class="active">
                        <a href="[data-tab=url]" data-toggle="tab">链接导入</a>
                    </li>
                    <li>
                        <a href="[data-tab=data]" data-toggle="tab">内容导入</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div data-tab="url" class="tab-pane active">
                        <div class="form-group clearfix">
                            <label class="col-sm-2 control-label">链接地址：</label>
                            <div class="col-sm-10">
                                <input class="form-control" name="url" type="text" placeholder="http://...">
                            </div>
                        </div>
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" checked name="only_main" value="only_main">
                                智能提取正文
                            </label>
                        </div>
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="download" value="download">
                                下载图片
                            </label>
                        </div>
                        <div class="clearfix">
                            <div class="pull-right">
                            <button class="editor-btn ok">确定</button><button class="editor-btn" data-dismiss="modal">取消</button>
                            </div>
                        </div>
                    </div>
                    <div data-tab="data" class="tab-pane" style="height: 320px;">
                        <div class="form-group">
                            <label >HTML内容：</label>
                            <textarea id="message-text" class="form-control" name="html" id="html"></textarea>
                        </div>
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" checked  name="only_main" value="only_main">
                                智能提取正文
                            </label>
                        </div>
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="download" value="download">
                                下载图片
                            </label>
                        </div>
                        <div class="clearfix">
                            <div class="pull-right">
                            <button class="editor-btn ok">确定</button><button class="editor-btn" data-dismiss="modal">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


{%endblock content%}

{%block scripts%}
<script>
    window.EDITBOOK = {
        book: {{book.id}},
        backoff: '<a class="btn book-tool-btn backoff-btn" href="{{url_for("admin.index")}}"><img src="{{url_for("static", filename=current_user._50px_avatar())}}"></a>',
    };
</script>


{%if config.get("DEBUG")%}
{%include "_common-js.html"%}
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/bootstrap-treeview/bootstrap-treeview.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/sortable/Sortable.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/katex/katex.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/prettify.min.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/codemirror/lib/codemirror.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/codemirror/addon/mode/overlay.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/codemirror/mode/markdown/markdown.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/codemirror/mode/gfm/gfm.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/plugins/marked/marked.js")}}"></script>
<script src="{{url_for("static", filename="asserts/googlediff-master/javascript/diff_match_patch_uncompressed.js")}}"></script>
<script src="{{url_for("static", filename="asserts/md5/js/md5.js")}}"></script>
<script src="{{url_for("static", filename="asserts/jquery-file-upload/js/vendor/jquery.ui.widget.js")}}"></script>
<script src="{{url_for("static", filename="asserts/jquery-file-upload/js/jquery.fileupload.js")}}"></script>
<script src="{{url_for("static", filename="asserts/mousetrap/mousetrap.js")}}"></script>
<script src="{{url_for("static", filename="asserts/bookeditor/bookeditor.js")}}"></script>
<script src="{{url_for("static", filename="js/admin/edit.js")}}"></script>
{%else%}
<script src="{{url_for("static", filename="dist/js/edit.min.js")}}"></script>
{%endif%}

{{super()}}
{%endblock scripts%}


